app.config(['$routeProvider','$httpProvider', function ($routeProvider,$httpProvider) {

    //$httpProvider.defaults.headers.common={"Authorization": 'test'};

    //$httpProvider.defaults.withCredentials = true;
    $routeProvider
    //.when('/',{
    //    templateUrl:'code/view/article/article.html',
    //    controller:'articleCtrl'})
        .when('/article', {
            templateUrl: 'code/view/article/article.html',
            controller: 'articleCtrl'
        })
        .when('/', {
            templateUrl: 'code/view/notice.html',
            controller: ''
        })

        .when('/video', {
            templateUrl: 'code/view/video/video.html',
            controller: 'videoCtrl'
        })

        .when('/writer', {
            templateUrl: 'code/view/writer/writer.html',
            controller: 'writerCtrl'
        })

        .when('/sign', {
            templateUrl: 'code/view/sign/sign.html',
            controller: 'signCtrl'
        })

        .when('/activity', {
            templateUrl: 'code/view/activity/activity.html',
            controller: 'activityCtrl'
        })

        .when('/mall', {
            templateUrl: 'code/view/mall/mall.html',
            controller: 'mallCtrl'
        })

        .when('/exchange', {
            templateUrl: 'code/view/exchange/exchange.html',
            controller: 'exchangeCtrl'
        })

        .when('/goods', {
            templateUrl: 'code/view/goods/goods.html',
            controller: 'goodsCtrl'
        })

        .when('/manage', {
            templateUrl: 'code/view/manage/manage.html',
            controller: 'manageController'
        })
        .when('/subject', {
            templateUrl: 'code/view/subject/subject.html',
            controller: 'subjectCtrl'
        })
        .when('/push', {
            templateUrl: 'code/view/push/push.html',
            controller: 'pushCtrl'
        })


        //机器人系列
        .when('/robot', {
            templateUrl: 'code/view/robot/robot.html',
            controller: 'robotCtrl'
        })
        // 新增美图
        .when('/addImg',{
            templateUrl: 'code/view/robot/add_img.html',
            controller: 'imgCtrl'
        })
        //新增表情包
        .when('/addMotion',{
            templateUrl: 'code/view/robot/add_motion.html',
            controller: 'motionCtrl'
        })
        //新增歌曲
        .when('/addAudio',{
            templateUrl: 'code/view/robot/add_audio.html',
            controller: 'audioCtrl'
        })
        //新增故事
        .when('/addStory',{
            templateUrl: 'code/view/robot/add_story.html',
            controller: 'storyCtrl'
        })
        //新增游戏
        .when('/addGame',{
            templateUrl: 'code/view/robot/add_games.html',
            controller: 'gameCtrl'
        })
        //新增段子
        .when('/addJoke',{
            templateUrl: 'code/view/robot/add_jokes.html',
            controller: 'jokeCtrl'
        })
        //新增问题
        .when('/addQues',{
            templateUrl: 'code/view/robot/add_ques.html',
            controller: 'quesCtrl'
        })



        //广告管理相关路由
        .when('/ad/adImg', {
            templateUrl: 'code/view/ad/ad_img.html',
            controller: 'adImgCtrl'
        })
        .when('/ad/adAudio', {
            templateUrl: 'code/view/ad/ad_audio.html',
            controller: 'adAudioCtrl'
        })
        .when('/ad/resource', {
            templateUrl: 'code/view/ad/resource.html',
            controller: 'adResourceCtrl'
        })
        //广告，视频，文章等新增
        .when('/ad/adImgAdd', {
            templateUrl: 'code/view/ad/add/ad_img_add.html',
            controller: 'adImgAddCtrl'
        })
        .when('/ad/adAudioAdd', {
            templateUrl: 'code/view/ad/add/ad_audio_add.html',
            controller: 'adAudioAddCtrl'
        })
        .when('/ad/resourceAdd', {
            templateUrl: 'code/view/ad/add/resource_add.html',
            controller: 'adResourceAddCtrl'
        })


        .when('/video/videoAdd', {
            templateUrl: 'code/view/video/video_add.html',
            controller: 'videoAddCtrl'
        })
        .when('/writer/writerAdd', {
            templateUrl: 'code/view/writer/writer_add.html',
            controller: 'writerAddCtrl'
        })
        .when('/sign/signAdd', {
            templateUrl: 'code/view/sign/sign_add.html',
            controller: 'signAddCtrl'
        })
        .when('/exchange/exchangeAdd', {
            templateUrl: 'code/view/exchange/exchange_update.html',
            controller: 'exchangeAddCtrl'
        })
        .when('/article/articleAdd', {
            templateUrl: 'code/view/article/article_add.html',
            controller: 'articleAddCtrl'

        })
        .when('/activity/activityAdd', {
            templateUrl: 'code/view/activity/activity_add.html',
            controller: 'activityAddCtrl'
        })
        .when('/mall/mallAdd', {
            templateUrl: 'code/view/mall/mall_add.html',
            controller: 'mallAddCtrl'
        })
        .when('/goods/goodsAdd', {
            templateUrl: 'code/view/goods/goods_add.html',
            controller: 'goodsAddCtrl'
        })
        .when('/subject/subjectAdd', {
            templateUrl: 'code/view/subject/subject_add.html',
            controller: 'subjectAddCtrl'
        })
        .when('/push/pushAdd',{
            templateUrl:'code/view/push/push_add.html',
            controller:'pushAddCtrl'
        })

    //问题录入的界面
        .when('/questions', {
            templateUrl: 'code/view/ques/questions.html',
            controller: 'quesCtrl'
        })
        .when('/questions/questionsAdd', {
            templateUrl: 'code/view/ques/questions_add.html',
            controller: 'quesAddCtrl'

        })

    //.otherwise({redirectTo:'/article'});

}])





